package com.main.modulemysql.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.main.modulemysql.entity.ChartRateVO;
import com.main.modulemysql.entity.HjzkFaultFind;
import com.main.modulemysql.entity.TableRateVO;
import com.main.modulemysql.mapper.HjzkFaultFindMapper;
import com.main.modulemysql.service.IHjzkFaultFindService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author IceZhang
 * @since 2018-08-07
 */
@Service
public class HjzkFaultFindServiceImpl extends ServiceImpl<HjzkFaultFindMapper, HjzkFaultFind> implements IHjzkFaultFindService {



    @Override
    public Integer selectFaultCountByCategoryCode(String categoryCode) {
        EntityWrapper<HjzkFaultFind> entityWrapper=new EntityWrapper<>();
        entityWrapper.eq("category_code",categoryCode);
        return baseMapper.selectCount(entityWrapper);
    }

    @Override
    public List<HjzkFaultFind> getFaultListByFacilityCode(String facilityCode) {
        return baseMapper.getFaultListByFacilityCode(facilityCode);
    }

    @Override
    public List<ChartRateVO> getChartRateVO(Integer month, String facilityCode) {
        return baseMapper.getChartRateVO(month,facilityCode);
    }

    @Override
    public List<TableRateVO> getTableRateVO(Integer month) {
        return baseMapper.getTableRateVO(month);
    }
}
